package com.ethan.excetion;

import com.ethan.enums.BizCodeEnum;
import lombok.Data;

/**
 * @Description:
 * @Author ethan
 * @CreateDate: 2022/02/17 下午4:31
 * @UpdateDate: 2022/02/17 下午4:31
 * @Version 1.0
 */
@Data
public class BizException extends RuntimeException {
    private int code;
    private String msg;

    public BizException(int code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }
    public BizException(BizCodeEnum bizCodeEnum) {
        super(bizCodeEnum.getMessage());
        this.code = bizCodeEnum.getCode();
        this.msg = bizCodeEnum.getMessage();
    }
}
